BISON_TARGET(RefParser ${CMAKE_CURRENT_SOURCE_DIR}/parse.y  ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c)
FLEX_TARGET(RefParser  ${CMAKE_CURRENT_SOURCE_DIR}/lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c)
#SET(INCLUDE_DIR ${INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
#COPY_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ast.h ${CMAKE_CURRENT_BINARY_DIR}/ast.h)
ADD_LIBRARY(refparse ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c ${CMAKE_CURRENT_SOURCE_DIR}/ast.c)
ADD_EXECUTABLE(parse_test ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c ${CMAKE_CURRENT_SOURCE_DIR}/ast.c ${CMAKE_CURRENT_SOURCE_DIR}/parse_test.c)
SET_TARGET_PROPERTIES(refparse PROPERTIES COMPILE_FLAGS "-Wno-implicit -Wno-unused -I ${CMAKE_CURRENT_SOURCE_DIR}")
SET_TARGET_PROPERTIES(parse_test PROPERTIES COMPILE_FLAGS "-Wno-implicit -Wno-unused -I ${CMAKE_CURRENT_SOURCE_DIR}")
ADD_TEST(test_parser ${CMAKE_CURRENT_SOURCE_DIR}/test_parser.pl)

